//
//  SlideCollectionViewCell.m
//  projectA_kuaiZuiManHua
//
//  Created by 张祎 on 15-3-23.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "SlideCollectionViewCell.h"
#import "UIImageView+WebCache.h"
@implementation SlideCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.slideImageView = [[UIImageView alloc]init];
        [self.contentView addSubview:_slideImageView];
        [_slideImageView release];
        
    }
    return self;
}
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{

    _slideImageView.frame = CGRectMake(0, 0, 375, 220);
    _slideImageView.backgroundColor = [UIColor greenColor];
    
}

- (void)setGalleryItem:(GalleryItem *)galleryItem
{
    if (_galleryItem != galleryItem) {
        [_galleryItem release];
        _galleryItem = [galleryItem retain];
    }
    NSURL *url = [NSURL URLWithString:[_galleryItem.defaultImageUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
    
    [_slideImageView setImageWithURL:url];
}
    


@end
